<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('养修服务单项编辑')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-edit" th:object="${serviceItem}">
        <input name="id" th:field="*{id}" type="hidden" />

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项目名称：</label>
            <div class="col-sm-8">
                <input th:field="*{name}" class="form-control" type="text" name="name" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项原价：</label>
            <div class="col-sm-8">
                <input th:field="*{originalPrice}" class="form-control" type="number" step="0.01" name="originalPrice" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">服务项折扣价：</label>
            <div class="col-sm-8">
                <input th:field="*{discountPrice}" class="form-control" type="number" step="0.01"  name="discountPrice" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否套餐：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict:${@dict.getType('bus_car_ackage')}">
                    <input th:field="*{carPackage}" type="radio" th:id="${dict.dictValue}" name="carPackage" th:value="${dict.dictValue}"
                           th:checked="${dict.dictValue}"/>
                    <label th:for="${dict.dictValue}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>

		<div class="form-group">
			<label class="col-sm-3 control-label">服务分类：</label>
			<div class="col-sm-8">
				<select th:field="*{serviceCatalog}" id="target" name="serviceCatalog" class="form-control m-b">

					<option  th:each="dict:${@dict.getType('bus_car_catalog')}"  th:value="${dict.dictValue}" th:text="${dict.dictLabel}">页签</option>
				</select>
			</div>
		</div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">备注：</label>
            <div class="col-sm-8">
                <textarea th:field="*{info}" class="form-control" type="text" name="info" required></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    let prefix = ctx + "business/serviceItem";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
        }
    }
</script>
</body>
</html>
